Kanzi 3.9.10
kanzi::DynamicPropertyType< Type > Class Template Reference

DynamicPropertyType is a handle to an existing property type. More...

#include <kanzi/core/property/dynamic_property_type.hpp>

Inheritance diagram for kanzi::DynamicPropertyType< Type >:
[legend]

Public Member Functions

 DynamicPropertyType (AbstractPropertyType abstractPropertyType)
 Constructor.
 
 DynamicPropertyType (AbstractPropertyTypeDescriptor &abstractDescriptor)
 Constructor.
 
 DynamicPropertyType (DynamicPropertyType< Type > &&other) noexcept
 Constructor.
 
 DynamicPropertyType (string_view name)
 Constructor.
 
DynamicPropertyType< Type > & operator= (DynamicPropertyType< Type > &&other) noexcept
 
void swap (DynamicPropertyType< Type > &other) noexcept
 
 ~DynamicPropertyType ()
 Destructor.
 
- Public Member Functions inherited from kanzi::PropertyType< Type, typename >
Descriptorget () const
 
uint32_t getChangeFlags () const
 Gets the change flags for a property type.
 
PropertyDataType getDataType () const
 Gets the data type of a property type.
 
Traits::ReturnType getDefaultValue () const
 Gets the default value of a property type.
 
PropertyTypeEditorInfoSharedPtr getEditorInfo () const
 Gets the editor information of a property type.
 
const chargetName () const
 Gets the fully qualified name of a property type in the form "Class.PropertyType".
 
const chargetUnqualifiedName () const
 Gets the unqualified name of a property type in the form "PropertyType".
 
bool isInherited () const
 Returns whether a property type is inheritable.
 
 operator AbstractPropertyType () const
 Converting operator to get AbstractPropertyType instance referring to this PropertyType instance.
 
 PropertyType (FixedString name)
 Constructor.
 
 PropertyType (FixedString name, DataType defaultValue, uint32_t changeFlags, bool inheritable)
 Constructor.
 
 PropertyType (FixedString name, DataType defaultValue, uint32_t changeFlags, bool inheritable, PropertyTypeEditorInfoSharedPtr editorInfo)
 Constructor.
 
 PropertyType (MetadataGeneratedName name)
 Constructor.
 
 PropertyType (MetadataGeneratedName name, DataType defaultValue, uint32_t changeFlags, bool inheritable)
 Constructor.
 
 PropertyType (MetadataGeneratedName name, DataType defaultValue, uint32_t changeFlags, bool inheritable, PropertyTypeEditorInfoSharedPtr editorInfo)
 Constructor.
 
 ~PropertyType ()
 Destructor.
 

Static Public Member Functions

static OptionalDynamicPropertyType< Type > tryCreate (string_view name)
 Creates an OptionalDynamicPropertyType that holds a DynamicPropertyType instance with the given name.
 

Friends

void swap (DynamicPropertyType< Type > &lhs, DynamicPropertyType< Type > &rhs) noexcept
 

Additional Inherited Members

- Public Types inherited from kanzi::PropertyType< Type, typename >
using DataType
 
using Descriptor
 
using Traits
 
- Protected Member Functions inherited from kanzi::PropertyType< Type, typename >
 PropertyType ()
 Constructor.
 

Detailed Description

template<class Type>
class kanzi::DynamicPropertyType< Type >

DynamicPropertyType is a handle to an existing property type.

You can use it to set or get from a node a property type value with a specific data type.

You can use a DynamicPropertyType to access property types when you have their data type and fully qualified name. When you do not have a fully qualified name or data type of a property type, or they are irrelevant, to access property types, use the AbstractPropertyType type.

To learn how to create a Kanzi property type, see PropertyType.

Examples

To create a property type with a fully qualified name for an existing property type:

// You can create a dynamic property type handle to an existing property type by using the fully qualified name.
// To set and get a property value for a property type, you need either:
// - DynamicPropertyType object that refers to an existing property type.
// - PropertyType object. For example, Node::VisibleProperty.
DynamicPropertyType<bool> visibleProperty("Node.Visible");
node->setProperty(visibleProperty, false);

Constructor & Destructor Documentation

◆ DynamicPropertyType() [1/4]

template<class Type >
kanzi::DynamicPropertyType< Type >::DynamicPropertyType ( string_view name)
inlineexplicit

Constructor.

Creates a DynamicPropertyType instance referring to an existing property type with the given name.

Parameters
nameFully qualified name of an existing property type in the Kanzi property system.
Exceptions
logic_errorif there is no property type with the given name in the Kanzi property system or the data type does not match the existing property type with the given name.

◆ DynamicPropertyType() [2/4]

template<class Type >
kanzi::DynamicPropertyType< Type >::DynamicPropertyType ( AbstractPropertyType abstractPropertyType)
inlineexplicit

Constructor.

Creates a DynamicPropertyType instance that refers to the same existing property type as the given AbstractPropertyType instance does.

Parameters
abstractPropertyTypeAbstractPropertyType instance that refers to the existing property type in the Kanzi property system.
Exceptions
invalid_argumentif abstractPropertyType is not valid.
logic_errorif the data type does not match the existing property type to which the given abstractPropertyType refers.

◆ DynamicPropertyType() [3/4]

template<class Type >
kanzi::DynamicPropertyType< Type >::DynamicPropertyType ( AbstractPropertyTypeDescriptor & abstractDescriptor)
inlineexplicit

Constructor.

Creates a DynamicPropertyType instance that refers to the given AbstractPropertyTypeDescriptor.

Note
This constructor solves a special case, prefer to use the other overloads.
Parameters
abstractDescriptorAbstractPropertyTypeDescriptor instance of an existing property type in the Kanzi property system.
Exceptions
logic_errorif the data type does not match the existing property type.

◆ DynamicPropertyType() [4/4]

template<class Type >
kanzi::DynamicPropertyType< Type >::DynamicPropertyType ( DynamicPropertyType< Type > && other)
inlinenoexcept

Constructor.

◆ ~DynamicPropertyType()

template<class Type >
kanzi::DynamicPropertyType< Type >::~DynamicPropertyType ( )
inline

Destructor.

Member Function Documentation

◆ tryCreate()

template<class Type >
static OptionalDynamicPropertyType< Type > kanzi::DynamicPropertyType< Type >::tryCreate ( string_view name)
inlinestatic

Creates an OptionalDynamicPropertyType that holds a DynamicPropertyType instance with the given name.

Parameters
nameFully qualified name of an existing property type in the Kanzi property system.
Returns
If the given name refers to an existing property type, returns the OptionalDynamicPropertyType that holds the DynamicPropertyType instance, otherwise, returns null.
Since
Kanzi 3.9.7

◆ operator=()

template<class Type >
DynamicPropertyType< Type > & kanzi::DynamicPropertyType< Type >::operator= ( DynamicPropertyType< Type > && other)
inlinenoexcept

◆ swap()

template<class Type >
void kanzi::DynamicPropertyType< Type >::swap ( DynamicPropertyType< Type > & other)
inlinenoexcept

Friends And Related Symbol Documentation

◆ swap

template<class Type >
void swap ( DynamicPropertyType< Type > & lhs,
DynamicPropertyType< Type > & rhs )
friend

The documentation for this class was generated from the following file: